-
Notifications
You must be signed in to change notification settings - Fork 109
Integration test reorg and build sharding #540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements a custom pytest plugin for test sharding, allowing tests to be automatically distributed across multiple CI jobs for parallel execution. This replaces the previous manual directory-based test splitting approach with a more flexible, hash-based distribution system. Additionally, integration tests have been reorganized into top-level folders that group tests by the client type and setup requirements needed.
This should bring down the total CI runtime to ~8 minutes or less.
Changes
Core Implementation
New pytest plugin (
tests/pytest_shard.py):pytest_addoptionhook to add--splitsand--groupcommand-line optionspytest_collection_modifyitemshook to filter tests based on shard assignmentPYTEST_SPLITSandPYTEST_GROUPas alternatives to command-line optionsPlugin registration (
tests/conftest.py):CI Workflow Updates
Updated
.github/workflows/testing-integration.yaml:rest_synctests: Now uses 8 shards (was manually split by directory)rest_asynciotests: Now uses 5 shards (was manually split by directory)grpctests: No sharding (runs all tests in single job, includingtests/integration/rest_sync/db/datawithUSE_GRPC='true')Updated
.github/actions/run-integration-test/action.yaml:pytest_splitsandpytest_groupinput parametersTest Reorganization
tests/integration/):rest_sync/: Tests using the synchronous REST client (Pinecone())Index()objects for database operationsUSE_GRPC='true'environment variabledb/(control and data operations),inference/, andadmin/testsrest_asyncio/: Tests using the asynchronous REST client (Pinecone().IndexAsyncio())IndexAsyncio()objectspytest-asynciofor async test executiondb/(control and data operations) andinference/testsgrpc/: Tests using the GRPC client (PineconeGRPC())PineconeGRPC()client andGRPCIndexobjectsdb/data/tests for GRPC-specific functionalityBug Fixes
tests/integration/rest_sync/db/control/pod/conftest.py):NotFoundExceptionhandling inattempt_delete_indexfunctionhas_indexcheck anddescribe_indexcallTesting
tests/unit/test_pytest_shard.py):testdirlimitations (plugin loading in isolated environments)Documentation
docs/maintainers/testing-guide.md:testing-integration.yamlBenefits
conftest.pywith appropriate fixtures, reducing complexity and potential conflictsUsage
Command-line
Environment variables
Testing
Notes